
    class X{
        Y y=new Y();//1
        public X(){//2
            System.out.print("执行父类的构造方法：");
            System.out.println("X");
        }
    }
    class Y{
        public Y(){//3
            System.out.println("Y");
        }
    }
    class Z extends X{
        Y y=new Y();//4
        public Z(){//5

            System.out.print("执行子类构造方法：");
            System.out.println("Z");
        }
        public static void main(String[] args) {
            new Z();
        }
    }
